<template>
	<view>
		<view class="cn">
			<input v-model="curData.className"/>
		</view>
		<view class="cm" >
			<p>班级名称</p>
		</view>
		
		<view class="btn">
			<button @click="bc" style="background-color: #F5BF46;">保存</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				curData:{
					id: null,
					className: null,
				}
			}
		},
		onLoad(e) {
			
			this.curData.id=e.classId
			this.curData.className=e.className
		},
		methods: {
			bc(){
				uni.$api.editClass(this.curData).then(res =>{
					//跳转页面
					uni.$emit("editClass")
					uni.navigateBack({
						delta:2
					})
				})
			}
		}
	}
</script>

<style lang="scss">
	.cn{
		width: 100%;
		height: 70rpx;
		position: relative;
		top: 200rpx;
		// margin-top: 200rpx;
		border-bottom:4rpx solid #ababab ;
	}
	
	.cn input{
		text-align: center;
	}
	
	p{
		text-align: center;
		line-height: 100rpx;
		color: #ababab;
	}
	.cm{
		width: 100%;
		height: 100rpx;
		position: relative;
		top: 200rpx;
	}
	.btn{
		width: 100%;
		height: 130rpx;
		border-top: 3rpx solid #ababab;
		position: fixed;
		bottom: 0rpx;
		
	}
	
	.btn button{
		width: 30%;
		border: #F5BF46 1rpx solid;
		border-radius: 60rpx;
		color: #eee;
		font-weight: 700;
		margin-top: 15rpx;
	}
	

</style>
